package com.guanyong.www.config;

import com.guanyong.model.KeyBaseModel;
import com.guanyong.services.KeybaseService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.*;

/**
 * Created by Administrator on 2017/9/28 0028.
 */
public class MovieIndex {
    private static Map<Integer,KeyBaseModel> movieMap=setMovieList();

    private MovieIndex(){}


    private static Map<Integer,KeyBaseModel> setMovieList() {
        KeybaseService keybaseService = new KeybaseService();
        List<KeyBaseModel> list =keybaseService.selectByAll();
        Map<Integer,KeyBaseModel> map = new HashMap<Integer, KeyBaseModel>();
        for (KeyBaseModel keyBaseModel:list){
            map.put(keyBaseModel.getId(),keyBaseModel);
        }
        return map;
    }

    public static Map<Integer,KeyBaseModel> getMovieMap(){
            return movieMap;
    }
}
